<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>产品追溯</title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<link rel="stylesheet" href="${pageContext.request.contextPath }/assets/css/layui.css"  media="all">
	<link rel="stylesheet" href="${pageContext.request.contextPath }/assets/css/toastr.min.css"  media="all">
	<style type="text/css">
		#tbody input{
			width: 60%;
			display: inline-block;
			float: right;
		}
	</style>
</head>
<body>
<table class="layui-table">
	<thead>
		<tr>
			<th colspan="2">
				<span>排产单号</span>
				<div class="layui-inline">
					<input class="layui-input" name="keyword" id="keyword" style="width: 80%;display: inline;"/>
				</div>
				<button class="layui-btn layui-btn-blue" style="margin: 0 0 0 10px" data-type="reload" onclick="selectProductTracingByOddNumber()"><i class="layui-icon layui-icon-search">搜索</i></button>
			</th>
		</tr>
	</thead>
	<tbody id="tbody">
		<tr>
			<td>
				<span>总排产量</span>
				<input class="layui-input" id="pcCount" name="pcCount" readonly/>
			</td>
			<td>
				<span>每日排产量</span>
				<input class="layui-input" id="dayPcCount" name="dayPcCount" readonly/>
			</td>
		</tr>
		<tr>
			<td>
				<span>开始时间</span>
				<input class="layui-input" id="starttime" name="starttime" readonly/>
			</td>
			<td>
				<span>结束时间</span>
				<input class="layui-input" id="endtime" name="endtime" readonly/>
			</td>
		</tr>
		<tr>
			<td>
				<span>合格入库量</span>
				<input class="layui-input" id="qualified" name="qualified" readonly/>
			</td>
			<td>
				<span>降级数量</span>
				<input class="layui-input" id="demotion" name="demotion" readonly/>
			</td>
		</tr>
		<tr>
			<td>
				<span>报废数量</span>
				<input class="layui-input" id="baofeiNum" name="baofeiNum" readonly/>
			</td>
			<td>
			</td>
		</tr>
	</tbody>
</table>
<script src="${pageContext.request.contextPath }/assets/layui.js" charset="utf-8"></script>
<script src="${pageContext.request.contextPath }/assets/layui.all.js"></script>
<script src="${pageContext.request.contextPath }/assets/js/jquery.min.js" charset="utf-8"></script>
<script src="${pageContext.request.contextPath }/assets/js/toastr.min.js" charset="utf-8"></script>

<script type="text/javascript">
//日期格式转换
function createTime(v){
	var date = new Date(v);
    var y = date.getFullYear();
    var M = date.getMonth()+1;
    M = M<10?'0'+M:M;
    var d = date.getDate();
    d = d<10?("0"+d):d;
    var h = date.getHours();
    h = h<10?("0"+h):h;
    var m = date.getMinutes();
    m = m<10?("0"+m):m;
    var str = y+"-"+M+"-"+d+" "+h+":"+m;
    return str;
}
function selectProductTracingByOddNumber(){
	var keyword = $("#keyword").val();
	$.ajax({
		type:'post'
		,url:'${pageContext.request.contextPath }/productTracing/selectProductTracingByOddNumber.do'
		,data:{'keyword':keyword}
		,dataType:'json'
		,success:function(data){
			//console.log(data)
			$("#pcCount").val(data.pcCount);
			$("#dayPcCount").val(data.dayPcCount);
			$("#starttime").val(data.starttime);
			$("#endtime").val(data.endtime);
			$("#qualified").val(data.qualified);
			$("#demotion").val(data.demotion);
			$("#baofeiNum").val(data.baofeiNum);
		}
	})
}
toastr.options.positionClass = 'toast-top-center'; //提示框的位置设置为中上
</script>
</body>
</html>